home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / cpu / h6280 / h6280.h < prev    next >
C/C++ Source or Header  |  2000-04-04  |  3KB  |  73 lines

  1. /*****************************************************************************
  2.  
  3.     h6280.h Portable Hu6280 emulator interface
  4.  
  5.     Copyright (c) 1999 Bryan McPhail, mish@tendril.co.uk
  6.  
  7.     This source code is based (with permission!) on the 6502 emulator by
  8.     Juergen Buchmueller.  It is released as part of the Mame emulator project.
  9.     Let me know if you intend to use this code in any other project.
  10.  
  11. ******************************************************************************/
  12.  
  13. #ifndef _H6280_H
  14. #define _H6280_H
  15.  
  16. #include "osd_cpu.h"
  17.  
  18. enum {
  19.     H6280_PC=1, H6280_S, H6280_P, H6280_A, H6280_X, H6280_Y,
  20.     H6280_IRQ_MASK, H6280_TIMER_STATE,
  21.     H6280_NMI_STATE, H6280_IRQ1_STATE, H6280_IRQ2_STATE, H6280_IRQT_STATE
  22. #ifdef MAME_DEBUG
  23.     ,
  24.     H6280_M1, H6280_M2, H6280_M3, H6280_M4,
  25.     H6280_M5, H6280_M6, H6280_M7, H6280_M8
  26. #endif
  27. };
  28.  
  29. //#define LAZY_FLAGS  1
  30.  
  31. #define H6280_INT_NONE    0
  32. #define H6280_INT_NMI    1
  33. #define H6280_INT_TIMER    2
  34. #define H6280_INT_IRQ1    3
  35. #define H6280_INT_IRQ2    4
  36.  
  37. #define H6280_RESET_VEC    0xfffe
  38. #define H6280_NMI_VEC    0xfffc
  39. #define H6280_TIMER_VEC    0xfffa
  40. #define H6280_IRQ1_VEC    0xfff8
  41. #define H6280_IRQ2_VEC    0xfff6            /* Aka BRK vector */
  42.  
  43. extern int h6280_ICount;                /* cycle count */
  44.  
  45. extern void h6280_reset(void *param);            /* Reset registers to the initial values */
  46. extern void h6280_exit(void);                    /* Shut down CPU */
  47. extern int h6280_execute(int cycles);            /* Execute cycles - returns number of cycles actually run */
  48. extern unsigned h6280_get_context(void *dst);    /* Get registers, return context size */
  49. extern void h6280_set_context(void *src);        /* Set registers */
  50. extern unsigned h6280_get_pc(void);             /* Get program counter */
  51. extern void h6280_set_pc(unsigned val);         /* Set program counter */
  52. extern unsigned h6280_get_sp(void);             /* Get stack pointer */
  53. extern void h6280_set_sp(unsigned val);         /* Set stack pointer */
  54. extern unsigned h6280_get_reg (int regnum);
  55. extern void h6280_set_reg (int regnum, unsigned val);
  56. extern void h6280_set_nmi_line(int state);
  57. extern void h6280_set_irq_line(int irqline, int state);
  58. extern void h6280_set_irq_callback(int (*callback)(int irqline));
  59. extern const char *h6280_info(void *context, int regnum);
  60. extern unsigned h6280_dasm(char *buffer, unsigned pc);
  61.  
  62. READ_HANDLER( H6280_irq_status_r );
  63. WRITE_HANDLER( H6280_irq_status_w );
  64.  
  65. READ_HANDLER( H6280_timer_r );
  66. WRITE_HANDLER( H6280_timer_w );
  67.  
  68. #ifdef MAME_DEBUG
  69. extern int Dasm6280(char *buffer, int pc);
  70. #endif
  71.  
  72. #endif /* _H6280_H */
  73.